<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTableCarts extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('carts', function (Blueprint $table) {
            $table->increments('cart_id');
            $table->integer('gid')->unsigned()->default(0);
            $table->integer('uid')->unsigned()->default(0);
            $table->string('goods_name');
            $table->integer('price')->unsigned()->default(0);//加入购物车瞬间商品的价格
            $table->string('thumb_img');//缩略图
            $table->integer('addtime')->unsigned()->default(0);

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('carts');
    }
}
